-- @owner: @zhangbingliang
-- @date: 2025-07-31
-- @testpoint: 空表使用fetch_status函数测试
-- @modify: modified by @zhangbingliang at 2025-07-31

--prestep1:连接到D库
@conn PrimaryDbDmode;

-- step1:创建空表
drop table if exists t_fetch0002;
CREATE TABLE t_fetch0002 (ID INT);

--step2:调用游标后使用fetch_status函数查询;expect:返回-1
begin; /
DECLARE cur_fetch0002 CURSOR FOR SELECT ID FROM t_fetch0002; /
FETCH NEXT FROM cur_fetch0002;
select @@FETCH_STATUS; 
CLOSE cur_fetch0002;
end;

--step3:清理环境;expect:成功
drop table if exists t_fetch0002;